# -*- coding: utf-8 -*-

# -------------------------------
# Author    : linlingwei
# Email     : 951035650@qq.com
# File Name : deformerCore.py
# Date      : 2018/8/21
# IDE       : PyCharm
# Version   : 1.0.1
# -------------------------------

__author__ = "lin lingwei"
import traceback
import maya.cmds as mc
import maya.mel as mel
import maya.OpenMaya as OpenMaya
import maya.OpenMayaMPx as OpenMayaMPx

import sys

# command
class lRigMenu(OpenMayaMPx.MPxCommand):
	kPluginCmdName = "LcMenu"

	def __init__(self):
		OpenMayaMPx.MPxCommand.__init__(self)

	@staticmethod
	def cmdCreator():
		return OpenMayaMPx.asMPxPtr(lRigMenu())

	def doIt(self,argList):
		pass
	

# Initialize the script plug-in
def initializePlugin(plugin):
	pluginFn = OpenMayaMPx.MFnPlugin(plugin, __author__, "1.2.1", "Any")
	try:
		import scripts.userSetup as userSetup
		userSetup.run()
	except:
		traceback.print_exc()
	try:
		pluginFn.registerCommand(
			lRigMenu.kPluginCmdName, lRigMenu.cmdCreator
		)
	except:
		sys.stderr.write(
			"Failed to register command: %s\n" % lRigMenu.kPluginCmdName
		)
		raise

# Uninitialize the script plug-in
def uninitializePlugin(plugin):
	pluginFn = OpenMayaMPx.MFnPlugin(plugin)
	try:
		import scripts.lRigMenuCmd as lRigMenuCmd
		lRigMenuCmd.remove()
		lRigMenuCmd.refreshButton()
		
	except:
		traceback.print_exc()
	
	try:
		pluginFn.deregisterCommand(lRigMenu.kPluginCmdName)
	except:
		sys.stderr.write(
			"Failed to unregister command: %s\n" % lRigMenu.kPluginCmdName
		)
		raise